<template>
    <app>
        <div>
            <el-table
                    :data="tableData"
                    style="width: 100%">
                <el-table-column
                        prop="name"
                        width="180"
                        label="用户名"
                        >
                </el-table-column>
                <el-table-column
                        prop="amountConsumption"
                        width="180"
                        label="消费金额"
                        >
                </el-table-column>
                <el-table-column
                        prop="subsidy"
                        label="补贴金额"
                        width="180"
                />
                    <el-table-column
                            prop="remark"
                            label="支付金额"
                            width="180"
                    />

                <el-table-column
                        prop="payMethod"
                        width="180"
                        label="支付方式">
                </el-table-column>
                <el-table-column
                        prop="meal"
                        width="180"
                        label="餐别"
                />
                <el-table-column
                        prop="createtime"
                        width="180"
                        label="订单生成时间"
                />
            </el-table>
            <el-pagination
                    background
                    layout="prev, pager, next"
                    :page-count=pageSize
                    :current-page="currentPage"
                    @current-change="pageNum"
            >
            </el-pagination>
        </div>
    </app>
</template>

<script>
    export default {
        name: "adminStatements",
        data(){
            return{
                tableData:[],
                pageSize:1,
            }
        },
        methods:{
            getAdminStatements(pageNum){
                this.$api.getStatements(pageNum)
                .then(res=>{
                    this.tableData=res.data.data;
                    this.pageSize=res.data.pages
                })
            },
            pageNum(currentPage){
                this.getAdminStatements(currentPage)
            }
        },
        mounted() {
            this.getAdminStatements(1)
        }
    }
</script>

<style scoped>

</style>